<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"   pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>IPL 2011</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link rel="shortcut icon" href="images/cric_fav.ico" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
html {overflow-y:hidden;}
body {overflow-y:auto;}
#page-background {position:absolute; z-index:-1;}
#content {position:static;padding:10px;}
</style>
<script type="text/javascript" language="javascript">
	function validateLogin(){
	    //alert("validate");
		if ((document.register.loginUserName.value ==null) ||(document.register.loginUserName.value ==""))		
		{
			alert("Please enter User Name");
			return false;
	    }
	    else if ((document.register.loginPassword.value ==null) ||(document.register.loginPassword.value =="")) 
	    {
	      alert("Please enter password");
		  return false;
	    }
	}

</script>
</head>
<body>
<form action="/IPL5/processLogin.jsp"  name="register" method = "post" onSubmit="return validateLogin()">
<%
String resposeText = (String) session.getAttribute("resposeText");
String errorMesg = (String) session.getAttribute("errorMesg");


out.println("<script>alert(\\"+errorMesg+"\\)</script>");
if (session.getAttribute("resposeText") != null) {

	if(null != (String)session.getAttribute("resposeText")){ 
		out.println("<script>alert("+resposeText+")</script>");
    }else{
    	out.println("<script>alert(\"No Mesg\")</script>");
    }
	
	if(("Succesfully Submited").equals(resposeText)){ 
		out.println("<script>alert(\"Succesfully Submited\")</script>");
    }else if(("User Not Registered").equals(resposeText)){
    	out.println("<script>alert(\"User Not Registered\")</script>");
    }else if(("Entry already made").equals(resposeText)){
    	out.println("<script>alert(\"Entry already made\")</script>");
    }else if(("Please enter your name").equals(resposeText)){
    	out.println("<script>alert(\"Please enter your name\")</script>");
    }else if(("Exception Occurred").equals(resposeText)){
    	out.println("<script>alert(\"Exception Occurred\")</script>");
    }else if(("Unauthorized User").equals(resposeText)){
    	out.println("<script>alert(\"Unauthorized User\")</script>");
    }else if(("UserName Not Entered").equals(resposeText)){
    	out.println("<script>alert(\"UserName Not Entered\")</script>");
    }else{
    	out.println("<script>alert(\\"+errorMesg+"\\)</script>");
    }
} 

if(null != errorMesg){
	session.setAttribute("errorMesg", null);
}
%>

	<center>
	<div id="page-background">
		<img src="images/IPL-Sachin.jpg" width="98%" height="99%" alt="IPL 2012"></div>
	
	<h1><font face="Impact" color="#FF9900">I P </font><font face="Impact" color="#FFFFFF">L <font face="Impact" color="#3333FF">2</font> <font face="Impact" color="#FFFFFF">0 </font><font face="Impact" color="#66FF00">1 2</font></h1>
	
	<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
	<br/><br/>
	
	<!--div class="css-grd" align="left"-->
	
	<table width="90%">
	<tr>
		<td width="30%" align="left" >
			
        
		</td>
		<td>&nbsp;</td>
		
	</tr>
	<tr>
	<td width="30%" align="left" >
	
	
	</td>
	<td width="50%">&nbsp;</td>
	<td align="left" style="background-color:#3366CC;"width="20%" align="right" valign="top">
			<div>
				<%
				if(null != errorMesg){
					%>
					<div style="background-color:#FF0000;">
						<font face="Trebuchet MS Bold" color="#000000"><b>&nbsp;<%=errorMesg%></b></font>
					</div>
					<%

				}
				%>
			</div>
	<fieldset>
		
		<h3 align="left"><font face="Trebuchet MS Bold" color="#33FF00">&nbsp;Members Login</font></h3>
		<table width="100%"  cellpadding="5" cellspacing="3">
			<tr>
				<td align="right">
					<font color="#FFFFFF" face="Trebuchet MS Bold"><b>User Name</b></font>
				</td>
				<td>
					<input type="text" style="font-face:Trebuchet MS Bold;color:#FFFFFF;background:#000000;"  name="loginUserName"/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<font color="#FFFFFF" face="Trebuchet MS Bold"><b>Password:</b></font>
				</td>
				<td>
					<input type="password" style="font-face:Trebuchet MS Bold;color:#FFFFFF;background:#000000;"  name="loginPassword"/>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<center>
					<input type="submit" style="font-face:Trebuchet MS Bold;color:#000000;"  class="button1"  name="submit" value=" Play "/>
					&nbsp;<a style="font-face:Trebuchet MS Bold;color:#33FF00;" href="register.jsp">Register</a>
					</center>
				</td>
			</tr>
		</table>
		
	</fieldset>
	</td>
	</tr>
	</table>
  
<!--/div-->

</form>
</body>
</html>
<%
   if ( session.getAttribute("resposeText") != null && !("").equals(session.getAttribute("resposeText")))
   { 
		session.setAttribute("resposeText", null);
   }
%>
